//
//  SISSNetworkingManager+File.m
//  SISSAPP
//
//  Created by 袁应荣 on 2018/12/20.
//  Copyright © 2018 优房网. All rights reserved.
//

#import "SISSNetworkingManager+File.h"

@implementation SISSNetworkingManager (File)

// 7.1.1 公共批量上传图片
- (void)commonUploadFilesWithImages:(NSArray<UIImage *> *)images success:(void (^)(id _Nonnull))successBlock failed:(void (^)(NSError * _Nonnull))failedBlock {
    
    [kNetworkManager uploadFilesWithURLStr:URL_UPLOAD_FILE_LIST serverName:@"file" imagesArray:images parameters:@{} success:^(id responseObject) {
        NSLog(@"7.1.1 公共批量上传图片: responseObject-->%@",responseObject);
        if (successBlock) {
            successBlock(responseObject);
        }
    } failed:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

// 7.1.2 上传多个文件带水印
- (void)uploadFileListWatermark:(NSArray<UIImage *> *)images success:(void (^)(id _Nonnull))successBlock failed:(void (^)(NSError * _Nonnull))failedBlock {
    
    NSDictionary *parameters = @{@"license_no" : [SISSUserAccount shared].license_no};
    
    [kNetworkManager uploadFilesWithURLStr:URL_UPLOAD_FILE_LIST_WATERMARK serverName:@"file" imagesArray:images parameters:parameters success:^(id responseObject) {
        NSLog(@"7.1.2 上传多个文件带水印: responseObject-->%@",responseObject);
        if (successBlock) {
            successBlock(responseObject);
        }
    } failed:^(NSError *error) {
        if (failedBlock) {
            failedBlock(error);
        }
    }];
}

@end
